// *************************************************************************************************
//
// MK3D Engine
// --------------------------------------
// Copyright (C) 2007-2011 Zeb (mailto: zebbey@gmail.com)
//
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//
// *************************************************************************************************

#ifndef __H_MK_D3D9_SHADER__
#define __H_MK_D3D9_SHADER__

#include "mk_shader.h"

namespace MK3DE
{
	class CD3D9Shader : public CShader
	{
	public:
		CD3D9Shader();
		CD3D9Shader(const char* fileName);
		~CD3D9Shader();

	public:
		BOOL Load();
		BOOL Reload();

		BOOL TechniqueBegin(const char* techName, DWORD& passNum);
		BOOL PassBegin(DWORD idx);
		BOOL PassEnd();
		BOOL TechniqueEnd();

		BOOL SetFloatArray(const char* name, float* value, DWORD count);
		BOOL SetMatrix(const char* name, const D3DXMATRIX* mat);
		BOOL SetTexture(const char* name, CTexture2D* texture);
		BOOL SetTexture(const char* name, CTexture3D* texture);

		BOOL LoadFromBuffer(const BYTE* buffer, DWORD size);

	private:
		LPD3DXEFFECT    _effect;
	};
};

#endif // __H_MK_D3D9_SHADER__